<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
</head>

<body>
    <div id='app'>
        {{msg}}
        ======
        <father>
           <p slot='aa'>这是一个头部</p>
          <template>
            <p>这是主体内容1</p>
            <p>这是主体内容2</p>
          </template>
           <p slot='bb'>这是底部内容</p>
        </father>
    </div>
    <script type='text/javascript'>
        var obj = {
            template: `<div>
                这是一个obj组件====
                <header>
                    <slot name='aa'></slot>
                </header>
                <main>
                    <slot></slot>
                </main>
                <footer>
                    <slot name='bb'></slot>
                </footer>
                
            </div>
            
            `
        }
        Vue.component('father', obj)

        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'Hello Vue'
            }
        });
    </script>
</body>

</html>